﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace HMS_TabletClient
{
    public partial class SmallMap : Form
    {
        public SmallMap()
        {
            InitializeComponent();
        }
        public string author;
        public string[] joined;
        DataTable dt = new DataTable();
        DataTable dt2 = new DataTable();
        private void SmallMap_Load(object sender, EventArgs e)
        {
            dateTimePicker1.Value = System.DateTime.Now;
            dataGridView1.RowHeadersVisible = false;

            dt.Columns.Add("朝向", typeof(System.String));
            dt.Columns.Add("间", typeof(System.String));
            dt.Columns.Add("面积", typeof(System.String));
            dt.Columns.Add("评", typeof(System.String));
            dt.Columns.Add("查", typeof(System.String));
            dt.Columns.Add("修", typeof(System.String));
            dataGridView1.DataSource = dt;



            dataGridView2.RowHeadersVisible = false;

            dt2.Columns.Add("位置", typeof(System.String));
            dt2.Columns.Add("存在问题", typeof(System.String));
            dataGridView2.DataSource = dt2;




                   
            DataRow dr = dt2.NewRow();
            dr[0] = "东3,4,5 ";
            dr[1] = "前檐檩 糟朽";

            dt2.Rows.Add(dr);

            dr = dt2.NewRow();
            dr[0] = "院内 ";
            dr[1] = "存在危险树木";

            dt2.Rows.Add(dr);

            dr = dt2.NewRow();
            dr[0] = "院内 ";
            dr[1] = "2处下水不通";

            dt2.Rows.Add(dr);



            dr = dt2.NewRow();
            dr[0] = "院内 ";
            dr[1] = "电线老化";

            dt2.Rows.Add(dr);




        }
        public void sshow()
        {
            Author.Text += author;
            //   Joined.Text = joined;
            for (int i = 0; i < joined.Length; i++)
            {
               // Joined.Text += joined[i] + " ";
            }
        }
        private void newone_Click(object sender, EventArgs e)
        {
            NewRoom f2 = new NewRoom();
            f2.Show();
            f2.Owner = this;
            f2.FormClosed += new FormClosedEventHandler(f2_FormClosed);
            this.Enabled = false;
        }

        void f2_FormClosed(object sender, FormClosedEventArgs e)
        {
            //throw new NotImplementedException();
            this.Enabled = true;
        }
        
        public void insertroom(string dir, string rooms)
        {
            DataRow dr = dt.NewRow();
            dr[0] = dir;
            dr[1] = rooms;
            dr[2] = "公房";
            dr[3] = "未完成";
            dr[4] = "未完成";
            dr[5] = "未完成";

            dt.Rows.Add(dr);
            this.Enabled = true;
        }
        private void Joined_Click(object sender, EventArgs e)
        {

        }

        private void textBox2_TextChanged(object sender, EventArgs e)
        {

        }

        private void del_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void edit_Click(object sender, EventArgs e)
        {
            tableselected f1 = new tableselected();
            f1.FormClosed += new FormClosedEventHandler(f1_FormClosed);
            f1.Show();
            this.Hide();

        }

        void f1_FormClosed(object sender, FormClosedEventArgs e)
        {
            //throw new NotImplementedException();
            this.Show();
        }

        private void pictureBox3_Click(object sender, EventArgs e)
        {
            功能页.Photos f4 = new HMS_TabletClient.功能页.Photos();
            f4.Show();
            this.Hide();
            f4.FormClosed += new FormClosedEventHandler(f4_FormClosed);
        }

        void f4_FormClosed(object sender, FormClosedEventArgs e)
        {
            //throw new NotImplementedException();
            this.Show();
        }

        private void pictureBox4_Click(object sender, EventArgs e)
        {
            功能页.Navigation f5 = new HMS_TabletClient.功能页.Navigation();
            f5.Show();
            this.Hide();
            f5.FormClosed += new FormClosedEventHandler(f5_FormClosed);
        }

        void f5_FormClosed(object sender, FormClosedEventArgs e)
        {
            this.Show();
            //throw new NotImplementedException();
        }

        private void pictureBox2_Click(object sender, EventArgs e)
        {
            功能页.Charts f6 = new HMS_TabletClient.功能页.Charts();
            f6.Show();
            this.Hide();
            f6.FormClosed += new FormClosedEventHandler(f6_FormClosed);
        }

        void f6_FormClosed(object sender, FormClosedEventArgs e)
        {
            this.Show();
            //throw new NotImplementedException();
        }
        
    }
}
